package com.zhanggm.ry.product.controller;


import com.zhanggm.ry.product.entity.Sku;
import com.zhanggm.ry.product.service.ISkuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Set;

/**
 * <p>
 * sku表,该表表示具体的商品实体,如黑色的 64g的iphone 8 前端控制器
 * </p>
 *
 * @author zhanggm
 * @since 2023-04-25
 */
@RestController
@RequestMapping("/sku")
public class SkuController {

    @Autowired
    private ISkuService iSkuService;

    /**
     * 批量查询sku信息
     * @param ids
     * @return
     */
    @PostMapping("/getSkuByIds")
    public List<Sku> getSkuByIds(@RequestBody Set<Long> ids){
        List<Sku> skus = iSkuService.listByIds(ids);
        return skus;
    }

}
